#ifndef WIDGET_BUY_H
#define WIDGET_BUY_H



#include "widget_human.h"
#include "widget_ai.h"
#include "widget_network.h"
#include "players.h"
#include "gui.h"



#include <queue>
#include <QtGui>
#include <QObject>



class human_widget;

class ai_widget;

class network_widget;



//! @brief Gui class for buying units
class buy_widget:public QWidget
{

	Q_OBJECT

public:

	/** @brief Creates part of the gui
	*	@param parent Qt parent
	*	@param flags Qt flags
	*/
	buy_widget( QWidget* parent = 0, Qt::WindowFlags flags = 0 );
	
	/** @brief	Creates part of gui widget for specific type of the player
	*	@return	created widget
	*/
	QWidget* create_players_widget();

	
	//! widget layout
	QVBoxLayout* layout;

	//! part of buy gui for local players
	human_widget* human_w;
	//! part of buy gui for network players
	network_widget* network_w;
	//! part of buy gui for AI players
	ai_widget* ai_w;

	//! current part of the gui
	QWidget* current_widget;

	//! player number, for whom is the part generated
	unsigned int current_player_num;
	//! player, for whom is the part generated
	player* current_player;


private:

	//! button NEXT
	QPushButton* next_b;


private slots:
	
	//! @brief Qt slot that jumps to next buy screen, or play widget and starts game, when all players are ready
	void next();

};



#endif